import Vue from 'vue'
import VueRouter from 'vue-router'
import My from '../views/my/index.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/login',
    name: 'Login',
    component: () => import('../views/login/index.vue')
  },
  {
    path: '/',
    component: () => import('@/views/layout/index.vue'),
    children: [
      {
        path: '', // 默认子路由
        name: 'Home',
        component: () => import('@/views/home/index.vue')
      },
      {
        path: 'qa',
        name: 'Qa',
        component: () => import('../views/qa/index.vue')
      },
      {
        path: 'my',
        name: 'My',
        component: My
        // component: () => import('../views/my/index.vue')
      },
      {
        path: 'video',
        name: 'Video',
        component: () => import('../views/video/index.vue')
      }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
